const express = require("express");
const middleware = require("./middleware");
const Auth = require("./middleware/auth");
const app = express();
const routes = require("./routes/v1");

// 日志
middleware.logger(app);
// 核心中间件
middleware.core(app);
// session
middleware.session(app);
// 定位服务
middleware.location(app);
// 路由
app.use("/api/v1", Auth, routes);
// app.use("/api/v1", routes);
// 全局错误处理
middleware.error(app);

module.exports = app;
